#define  _CRT_SECURE_NO_WARNINGS
class Solution {
    vector<vector<int>> ret;
    vector<int> path;

    void dfs(int n, int k, int cut)
    {
        if (k == 0)
        {
            ret.push_back(path);
            return;
        }
        for (int i = cut + 1; i <= n - k; i++)
        {
            path.push_back(i + 1);
            dfs(n, k - 1, i);
            path.pop_back();
        }
    }
public:
    vector<vector<int>> combine(int n, int k) {
        dfs(n, k, -1);
        return ret;
    }
};